Passwd=$2
DomainPath=/home/vpopmail/domains/$Domain
rm -f $DomainPath/.qmail-$User
Note: The original qmailadmin has a bug.
In this line of the qmailadmin */user. c function call_hooks in the source package
Error = execl (cmd, Newu, Domain, Password1, Gecos, NULL );
The problem is obvious here. The second parameter of execl is arg0, which does not actually work. While Gecos is the rea
:
adduser:/home/vpopmail/bin/inituser.sh
deluser:/home/vpopmail/bin/deluser.sh
/Var/vpopmail/bin/deluser. sh:
#!/bin/bash
Domain=$1
User=$3
Passwd=$2
DomainPath=/home/vpopmail/domains/$Domain
rm-f$DomainPath/.qmail-$User
Note: The original qmailadmin has a bug.
In this line of the qmailadmin */user. c function call_hooks in the source package
Error = execl (cmd, Newu, Domain, Password1, Gecos, NULL );
The problem
CONDITION2; then breakfiCMDn...done
Example: doit.sh #!/bin/bash Name: doit.sh Purpose: shift through command line arguments Usage: doit.sh [args] while [ $# -gt 0 ] # or (( $# > 0 )) doecho $* shiftdoneExample: shift.sh #!/bin/bash #step through all the positional parameters until [ -z "$1" ] doecho "$1" shiftdoneecho 创建无限循环 while true; do 循环体 done until false; do
sudo模式下可以执行的权限。chown-Change the file owner and the user group, this command requires Superuser privileges:chown [ower][:[group]] file…The command changes whether the file owner or the file user group depends on the first parameter of the command.chown bob file 把文件所有者从当前所有者更改为用户bobchown bob:users file 把文件所有者更改为bob,所用户组更改为userschown :admins file 把文件所用户组改为adminschown bob: file 把文件所有者更改为用户bob,所用户组改为用户bob登录时的所属的组Ways to add Usersadduser [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID][--
% -f5`
if [ $used -gt 8 ];then
echo "$line" |tr -s " " :|cut -d: -f1,5
fi
fi
done
[[emailprotected] 9_4 ]#sh diskcheck1.sh
/dev/sda2:9%
/dev/sda1:16%3. Exercise: Scan each line of the/etc/passwd file, if the Gecos field is found to be empty, populate the user name and the unit phone is 62985600, and prompt the user's Gecos information modified successfully?[[emailprotected
and prohibited password CompositionPassword Change FrequencyRetrieve or reset the lost PasswordUser Password operationsThe password file is/etc/passwd, which is the database file of all users on the system. The form of each row is as follows:
Username: password: uid: gid: gecos: homedir: shell
This section briefly introduces the gecos field. This field is used to record the diversity of users. For example,
frequency to retrieve or reset the lost password the user's operation on the password file is/etc/passwd, it is the database file of all users on the system. The format of each row is as follows: username: password: uid: gid: gecos: homedir: shell to briefly introduce the gecos field. This field is used to record the diversity of users. For example, the user's full name, office location, office phone numbe
client, This is the configuration file of the client.
Slapd. conf ------------- this is the serVer configuration file.
Schema/-------------- this folder contains all schema template files, which can help us survive object classes and attribute classes.
There is an nis. schema that can meet all our needs.
Vim nis. schema
Define the attribute description of the tianshu directory structure
49 attributetype (1.3.6.1.1.1.1.2 NAME 'gecos'
50 DESC 'the
6.1/ETC/PASSWD fileLinux recognizes user's file/etc/passwd when user logs on/ETC/PASSWD consists of 7 fields:Login name (no more than 32 bits, no more than 8 bits after using NIS system)Encrypted password or password placeholders (most are actually placed in the/etc/shadow file, with MD5 encryption by default, Blowfish in SuSE, set by passwd command)UID (User ID) Number (32-bit unsigned number, recommended limit is 32767, root uid is 0, multiple account UID 0 will create potential security vulne
-namefull_nameChange a user's full name-H,--home-phonehome_phoneChange the user's home phone number.-R,--roomroom_number-W,--work-phonework_phoneChange the user ' s office phone number. -O,--otherotherChange the user's other GECOS information. This field was used toStore accounting information used by other applications, and can beChanged only by a superuser.-R,--rootchroot_dirApply changes in the Chroot_dir directory and use the configurationFil
Special usage One whileSyntax Formatwhile read line; DoLoop bodyDone Function: Reads each row in the/path/from/soemfile file sequentially and assigns this line to the line variableExample: Scan a/etc/passwd file for each row, if the Discovery gecos field is empty, populate the user name and the unit phone as 123, and prompt the user for Gecos information to be modified successfully#!/bin/bash#file=/etc/pass
Use of Linux User management commands
The first year of unix is January 1 ,.
Most of the current versions of Windows and linux follow the 3A user and permission management mechanism (Authencattion identity authentication mechanism, Authorzation authorization, and Accounting audit)
After the user enters the user name and password, the system finds the UID, GID, and group information in the passwd file to confirm whether the user exists. If so, log on to the account, perform the operation. If not
References:
Http://www.ibm.com/developerworks/cn/aix/library/au-aixuseradmin/
Http://blog.csdn.net/victor1220/article/details/5338331
The user (Group) management method in AIX is the same as that in rhel. It maintains several text files. Compared with commands and parameters, I prefer to modify files.Several files used
/Etc/passwd stores user information.
/Etc/security/passwd stores user password information,
/Etc/group stores user group information.
/Etc/security/group stores the management inf
SUBSTR (str,start,length);
Example: substr (' PHP tutorial is very good language ', 4,5);
The output is the is ve;
When the length of the START>STR, it is returned as ();
substr (' PHP is very good language ', 26,5);
substr (' PHP is very good language ', 4);
Output as (blank)
Output is V (indicates start and langth are 4)
When start is negative, start reading from the end of STR (* This is read from 1 instead of starting at 0).
substr (' PHP is very good language ', -4,5);
Output is Uage
When
Substr (str, start, length );
Example: substr ('php tutorial is very good language );
Output is ve;
If the length of start> str is returned ();
Substr ('php is very good language );
Substr ('php is very good language ', 4 );
Output as (blank)
Output is v (both start and langth are 4)
When start is a negative value, it starts to read from the end of str (* at this time, it starts to read from-1 rather than from 0 ),
Substr ('php is very good language );
Output as uage
When the value of length is
User Information file/etc/passwdUse the command grep as shown below to view user vampire information1 grep vampire/etc/passwd2 vampire:x:501:501::/home/vampire:/bin/bashInformation descriptionFirst field: User name (Vampire)Second field: Password bit (x), just a placeholder, the real password is stored in the/etc/shadow fileThird field: UID (501) User id,0 for Super User, 1~499 system user, generally can't log in system, also called pseudo user, 500 and above ordinary user, Administrator created
)-compute password hashes[[emailprotected] Eric usr]# man 5 passwdthe Field Descriptions Are:account The name of the user on the system. It should not contain capital letters. Password The encrypted user password, an asterisk (*), or the letter ' x '. (See Pwconv (8) for the expla-nation of ' X '.) UID the numerical user ID. GID the numerical primary group ID for this user. GECOS This field was op
score.sh 1 #!/bin/bash 2 Sum=0;i=1 3 while ((IExample: Scan each line of the/etc/passwd file, if the Gecos field is found to be empty, populate the user name and the unit phone, and prompt the user for Gecos information to be modified successfully.#!/bin/bashwhile Read line;d o comment= ' echo $line |cut-d:-f5 ' username= ' echo $line |cut-d:-f1 ' If [-Z ' $c Omment "];then chfn-f" $username "$username >/d
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.